﻿<%@ Page Title="Areas management" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="CategorieManagement.aspx.cs" Inherits="IAATO.CategorieManagement" %>


<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
    
    <asp:HiddenField runat="server" ID="hdfScrollIntoView" Value="False" />
    <script>
        if (document.getElementById('<% =hdfScrollIntoView.ClientID %>').value == 'True') {
            window.onload = function () { document.getElementById('<% =Table1.ClientID %>').scrollIntoView(); };
            document.getElementById('<% =hdfScrollIntoView.ClientID %>').value = 'False';
        }
    </script>


    <h1><%: Title %></h1>
    <br />
    <asp:Label runat="server" ID="lblError" Text="" Font-Bold="true" ForeColor="Red"></asp:Label>
    <asp:GridView CssClass="gridView" ID="gdwCategories" OnPageIndexChanging="gdwCategories_PageIndexChanging" runat="server" AutoGenerateColumns="False" OnRowDataBound="gdwCategories_RowDataBound" HeaderStyle-HorizontalAlign="Center" CellSpacing="-1" AllowPaging="True">
        <Columns>
            <asp:TemplateField HeaderText="Name">
                <ItemTemplate>
                    <asp:Label ID="lblNom" Text='<%# Eval("NOM") %>' runat="server" />
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Capacity">
                <ItemTemplate>
                    <asp:Label ID="lblCap" Text='<%# Eval("CAPACITE") %>' runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
        

            <asp:TemplateField HeaderText="Edit">
                <ItemTemplate>
                    <asp:ImageButton ImageUrl="~/Images/edit/edit-26.png" ID="modifierButton" CommandArgument='<%# Eval("ID") %>' OnClick="update_Click"  runat="server" Width="26" Height="26" BackColor="Transparent" />
                </ItemTemplate>
            </asp:TemplateField>


            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:ImageButton ImageUrl="~/Images/delete/delete-26.png" ID="deleteButton" CommandArgument='<%# Eval("ID") %>' OnClientClick="return confirm('Do you really want to delete this lign?');" OnClick="delete_Click" runat="server" Width="26" Height="26" BackColor="Transparent" CausesValidation="True" />
                </ItemTemplate>
            </asp:TemplateField>

        </Columns>
        
        <HeaderStyle />
    </asp:GridView>
    <br />

    <asp:Table CssClass="tableModifier" ID="Table1" runat="server">
        <asp:TableHeaderRow>
            <asp:TableHeaderCell>Name</asp:TableHeaderCell>
            <asp:TableHeaderCell>Capacity</asp:TableHeaderCell>

        </asp:TableHeaderRow>
        <asp:TableRow>
            <asp:TableCell><asp:TextBox runat="server" ID="txtNom" Width="110" Height="12" Font-Size="Small"></asp:TextBox></asp:TableCell>
            <asp:TableCell><asp:TextBox runat="server" ID="txtCap" Width="110" Height="12" Font-Size="Small"></asp:TextBox></asp:TableCell>
            <asp:TableCell>
                <asp:Button runat="server" ID="btnAjouter" Text="Add" OnClick="btnAjouter_Click"></asp:Button>
                <asp:Button runat="server" ID="btnModifier" Text="Save" OnClick="btnModifier_Click" Visible="false"></asp:Button>
                <asp:Button runat="server" ID="btnAnnuler" Text="Cancel" OnClick="btnAnnuler_Click" Visible="false"></asp:Button>
                <asp:HiddenField runat="server" ID="idUpdate"  Visible="false"/>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    
</asp:Content>
